<script setup>
import { ref } from 'vue'

const services = ref([]) // 用于存储从父组件传递的服务数据
</script>

<script>
function getDefaultServices() {
  return [
    { 
      category: 'hospital', 
      name: "住院护工", 
      price: 100, 
      image: "/static/images/services/serviceA.jpg"
    },
    // ... other services
  ];
}

onLoad((options) => {
  buttonId.value = options.buttonId
  serviceType.value = options.serviceType || 'all'
  
  // Initialize with default services
  services.value = getDefaultServices()

  // 监听服务数据更新
  uni.$on('updateServices', (data) => {
    services.value = data
    console.log('接收到的服务数据:', services.value)
  })
})
</script> 